﻿using System.Threading;

namespace Hsenl {
    public static class Timer {
        public static async HTask WaitFrame(int frameCount = 1, CancellationToken? cancellationToken = null) =>
            await TimerManager.Instance.WaitFrame(frameCount, cancellationToken);

        public static async HTask WaitTime(long ms, CancellationToken? cancellationToken = null) =>
            await TimerManager.Instance.WaitTime(ms, cancellationToken);

        public static async HTask WaitTimeWithScale(float ms, CancellationToken? cancellationToken = null) =>
            await TimerManager.Instance.WaitTimeWithScale(ms, cancellationToken);

        public static async HTask WaitTillTime(long tillMs, CancellationToken? cancellationToken = null) =>
            await TimerManager.Instance.WaitTillTime(tillMs, cancellationToken);

        public static async HTask WaitTillTimeWithScale(float tillMs, CancellationToken? cancellationToken = null) =>
            await TimerManager.Instance.WaitTillTimeWithScale(tillMs, cancellationToken);

        public static bool ClockTick(float timeInternal) => TimerManager.Instance.ClockTick(timeInternal);
    }
}